/*
 * UIImage.cpp
 */

#include "UIImage.h"

void UIImage::draw() {
  glPushMatrix();

  glTranslatef(_xpos, _ypos, _depth);

  glEnable(GL_TEXTURE_2D);
  glBindTexture(GL_TEXTURE_2D, _tex);

  glBegin(GL_QUADS);
  glColor3f(1.0,1.0,1.0);
  glNormal3f(0.0, 0.0, 1.0);

  glTexCoord2d(-1, 0);
  glVertex3f(0.0, 0.0, 0.0);
  glTexCoord2d(-1, -1);
  glVertex3f(0.0, _height, 0.0);
  glTexCoord2d(0, -1);
  glVertex3f(_width, _height, 0.0);
  glTexCoord2d(0, 0);
  glVertex3f(_width, 0.0, 0.0);

  glEnd();

  glPopMatrix();
}
